load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "livox_sdk2_headers",
    hdrs = glob(
        [
            "sdk_core/**/*.h",
        ],
    ),
    includes = ["sdk_core"],
    visibility = ["//visibility:private"],
)

cc_library(
    name = "FastCRC",
    srcs = glob(
        [
            "3rdparty/FastCRC/**/*.cpp",
        ],
    ),
    hdrs = glob(
        [
            "3rdparty/FastCRC/**/*.h",
        ],
    ),
    includes = ["3rdparty"],
    visibility = ["//visibility:private"],
)

cc_library(
    name = "rapidjson",
    hdrs = glob(
        [
            "3rdparty/rapidjson/**/*.h",
        ],
    ),
    includes = ["3rdparty/rapidjson"],
    visibility = ["//visibility:private"],
)

cc_library(
    name = "spdlog",
    hdrs = glob(
        [
            "3rdparty/spdlog/**/*.h",
        ],
    ),
    includes = ["3rdparty/spdlog"],
    visibility = ["//visibility:private"],
)

cc_library(
    name = "livox_sdk2",
    srcs = glob(
        [
            "sdk_core/**/*.cpp",
            "sdk_core/**/*.h",
            "3rdparty/**/*.cpp",
            "3rdparty/**/*.h",
        ],
    ),
    hdrs = glob([
        "include/**/*.h",
    ]),
    includes = ["include"],
    deps = [
        "FastCRC",
        "livox_sdk2_headers",
        "rapidjson",
        "spdlog",
    ],
)
